// user.controller.js
const {createUesr} = require('../service/user.service')
class UserController{

  async register(ctx,next){
    // 1.获取数据
    // console.log(ctx.request.body);
    
   const {username,userpassword} = ctx.request.body

   console.log(username,userpassword);

    // 2.操作数据库
    const res = await createUesr(username,userpassword)
    console.log(res,"rse");
    // 3.返回数据
    
    ctx.body = {username,userpassword}
    
  }
  async login(ctx,next){
    ctx.body = "登录成功！"
  }
  async baidu_map(ctx,next){
    ctx.body = "bauidu地图"
  }
}

module.exports = new UserController()